<?php

namespace App\Http\Controllers;

use App\Library\Requests\Base\BasePageRequest;
use App\Library\Requests\Base\IdRequest;
use App\Library\Requests\Base\SerialNumberRequest;
use App\Library\Requests\Product\DayTjRequest;
use App\Library\Requests\Product\ProductCustomerServicePagingRequest;
use App\Library\Requests\Product\ProductPageRequest;
use App\Library\Requests\Product\ProductStatusRequest;
use App\Library\Requests\Product\ProductUserPageRequest;
use App\Library\Requests\Product\TjRequest;
use App\Library\Service\ShopProductService;
use Illuminate\Http\JsonResponse;

class ShopProductController extends BaseController
{
    /**
     * @param ShopProductService $service
     */
    public function __construct(ShopProductService $service)
    {
        $this->service = $service;
    }

    /**
     * 发布商品统计
     * @param TjRequest $request
     * @return JsonResponse
     */
    public function tj(TjRequest $request): JsonResponse
    {
        return $this->service->tj($request);
    }

    /**
     * 产品日统计
     * @param DayTjRequest $request
     * @return JsonResponse
     *
     */
    public function dayTj(DayTjRequest $request): JsonResponse
    {
        return $this->service->dayTj($request);
    }

    /**
     * 分页
     * @param ProductPageRequest $request
     * @return JsonResponse
     *
     */
    public function paging(ProductPageRequest $request): JsonResponse
    {
        return $this->service->paging($request);
    }

    /**
     * 用户产品列表分页
     * @param ProductUserPageRequest $request
     * @return JsonResponse
     */
    public function userPaging(ProductUserPageRequest $request): JsonResponse
    {
        return $this->service->userPaging($request);
    }

    /**
     * 热卖
     * @param BasePageRequest $request
     * @return JsonResponse
     *
     */
    public function recommendList(BasePageRequest $request): JsonResponse
    {
        return $this->service->recommendList($request);
    }

    /**
     * 特价校验
     * @param IdRequest $request
     * @return JsonResponse
     */
    public function specialOffer(IdRequest $request): JsonResponse
    {
        return $this->service->specialOffer($request);
    }

    /**
     * 产品详情
     * @param IdRequest $request
     * @return JsonResponse
     */
    public function detail(IdRequest $request): JsonResponse
    {
        return $this->service->detail($request);
    }

    /**
     *
     * @param ProductStatusRequest $request
     * @return JsonResponse
     *
     */
    public function transStatus(ProductStatusRequest $request): JsonResponse
    {
        return $this->service->transStatus($request);
    }

    /**
     *
     * @param ProductCustomerServicePagingRequest $request
     * @return JsonResponse
     *
     */
    public function customerServicePaging(ProductCustomerServicePagingRequest $request): JsonResponse
    {
        return $this->service->customerServicePaging($request);
    }

    /**
     * 检查库存
     * @param SerialNumberRequest $request
     * @return JsonResponse
     */
    public function checkStock(SerialNumberRequest $request): JsonResponse
    {
        return $this->service->checkStock($request);
    }
}
